
<img  width="640" height="480" 
src="https://i02piccdn.sogoucdn.com/b01331dc93518d5d" 
data="./img/奥特曼1.jpg" 
/><br>
<img  width="640" height="480" 
src="https://i02piccdn.sogoucdn.com/b01331dc93518d5d" 
data="./img/奥特曼2.jpg" 
/><br>
<img  width="640" height="480" 
src="https://i02piccdn.sogoucdn.com/b01331dc93518d5d" 
data="./img/奥特曼3.jpg" 
/><br>
<img  width="640" height="480" 
src="https://i02piccdn.sogoucdn.com/b01331dc93518d5d" 
data="./img/奥特曼4.jpg" 
/><br>
<img  width="640" height="480" 
src="https://i02piccdn.sogoucdn.com/b01331dc93518d5d" 
data ="./img/奥特曼5.jpg" 
/><br>
<img  width="640" height="480" 
src="https://i02piccdn.sogoucdn.com/b01331dc93518d5d" 
data ="./img/奥特曼6.jpg" 
/>

<!-- <script src="http://unpkg.com/jquery"></script> -->
<!-- <script src="https://cdn.bootcss.com/jquery_lazyload/1.9.7/jquery.lazyload.js"></script> -->
<script>
    let t 
    function lazyLoad (){
        if(t){
            return
        }
        t = setTimeout(()=>{
            let h1 = window.innerHeight || document.documentElement.clientHeight
            let h2 = document .documentElement.scrollTop || document.body.scrollTop
            let totalHeight = h1+h2

            let imgsObj = document.querySelectorAll('img')

            imgsObj.forEach((item,index) =>{
                let imgTop = item.offsetTop
                if(imgTop<=totalHeight){
                    item.src = item.getAttribute('data')
                }
            })
            t=null
        },1000)
}
window.onscroll = lazyLoad
lazyLoad()
</script>















